#include <cstring>
#include <iostream>
#include <string>
#include <vector>
#include <unistd.h>
#include <fcntl.h>
#include <sys/stat.h>
#include <sys/socket.h>
#include <arpa/inet.h>
#include <netinet/in.h>
using namespace std;
static const string ip = "127.0.0.1";
static const uint16_t port = 8080;
int main(int argc, char *argv[])
{
    int socket_fd = socket(AF_INET, SOCK_STREAM, 0);
    struct sockaddr_in server;
    server.sin_family = AF_INET;
    server.sin_addr.s_addr = inet_addr(ip.c_str());
    server.sin_port = htons(port);
    connect(socket_fd, (struct sockaddr *)&server, sizeof(server));
    char buf[1024] = {0};
    recv(socket_fd, buf, sizeof(buf), 0);
    printf("buf : %s \n", buf);
    close(socket_fd);
    return 0;
}